/*
 * @Description: 农事任务处理
 */
import zhreq from "@/api/axios";
// import twoline from "@/api/axios-twoline";
let farmingTypeNo = sessionStorage.getItem("farmingTypeNo")
export default {
  /**
   * @description: 获取所有任务处理表格列表 *代表必填
   * @param {String/Number} page *
   * @param {String/Number} size *
   */
  getWorkTypeList(params) {
    params.entity = {
      "farmingTypeNo": JSON.parse(farmingTypeNo)
    }
    let zhenpar = { ...params, "organizationNo": 0 }
    return zhreq.post("/agriculturalWorkType/queryPageList", zhenpar);
  },
  getqueryAllList() {
    let zhenpar = { "farmingTypeNo": JSON.parse(farmingTypeNo), "organizationNo": sessionStorage.organizationNo }
    return zhreq.get("agriculturalWorkType/queryAll", zhenpar);
  },
  getqueryMethodList() {
    let zhenpar = { "farmingTypeNo": JSON.parse(farmingTypeNo), "organizationNo": sessionStorage.organizationNo }
    return zhreq.get("agriculturalTask/queryMethod", zhenpar);
  },
  queryWorkTypeList(id) {
    let zhenpar = { "farmingTypeNo": JSON.parse(farmingTypeNo), "organizationNo": sessionStorage.organizationNo }
    return zhreq.get(`agriculturalWorkType/query/${id}`, zhenpar);
  },
  //   获取处理结果集合
  queryResultList() {
    let zhenpar = { "farmingTypeNo": JSON.parse(farmingTypeNo), "organizationNo": sessionStorage.organizationNo }
    return zhreq.get(`agriculturalTask/queryResult`, zhenpar);
  },
  // 获取任务处理
  queryEquipmentList() {
    let zhenpar = { "farmingTypeNo": JSON.parse(farmingTypeNo), "organizationNo": sessionStorage.organizationNo }
    return zhreq.get(`equipment/queryAll`, zhenpar);
  },
  // 查询承租户
  querylessesList() {
    let zhenpar = { "farmingTypeNo": JSON.parse(farmingTypeNo), "organizationNo": sessionStorage.organizationNo }
    return zhreq.zhaxiosOut.get(`lessee/queryAll`, zhenpar);
  },
  /**
   * @description: 添加农事任务处理
   * @param {Object}  *
   */
  addmeslist(params) {
    let zhenpar = { ...params, "farmingTypeNo": sessionStorage.farmingTypeNo,
      "organizationNo": sessionStorage.organizationNo }
    return zhreq.post('/agriculturalWorkType/add', zhenpar);
  },
   // TODO:单个添加
   addmessingle(params) {
    params.farmingTypeNo = sessionStorage.farmingTypeNo
    // params.organizationNo = sessionStorage.organizationNo
    let zhenpar = { ...params }
    return axios.post('/v3/agriculturalTask/agriculturalTask/add', zhenpar);
  },
  /**
  * @description: 添加农事任务处理
  * @param {Object}  *
  */
  editmeslist(params) {
    let zhenpar = { ...params, "farmingTypeNo": sessionStorage.farmingTypeNo,
      "organizationNo": 0 }
    return zhreq.post('/agriculturalWorkType/edit', zhenpar);
  },
  /**
  * @description: 删除农事任务处理
  * @param {Object}  *
  */
  delmeslist(params) {
    let zhenpar = { ...params, "farmingTypeNo": sessionStorage.farmingTypeNo,
      "organizationNo": 0 }
    return zhreq.post('agriculturalWorkType/delList', zhenpar);
  },
};

